package rahmath.sharif.docrypt.constant;

public enum EncodingType {
	BASE2("Base2", 4096, 800)/*(name,8*1*x,8/1)*/, 
	BASE8("Base8", 4080, 266)/*(name,8*3*x,8/3)*/, 
	BASE16("Base16", 4096, 200)/*(name,8*4*x,8/4)*/, 
	BASE32("Base32", 4000, 160)/*(name,8*5*x,8/5)*/, 
	BASE64("Base64", 3072, 133)/*(name,8*6*x,8/6)*/;
	private String value;
	private int bufferSize;
	private int multiplier;

	private EncodingType(String value, int bufferSize, int multiplier) {
		this.value = value;
		this.bufferSize = bufferSize;
		this.multiplier = multiplier;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getValue() {
		return value;
	}

	public int getBufferSize() {
		return bufferSize;
	}

	public void setBufferSize(int bufferSize) {
		this.bufferSize = bufferSize;
	}

	public int getMultiplier() {
		return multiplier;
	}

	public void setMultiplier(int multiplier) {
		this.multiplier = multiplier;
	}

	private static final EncodingType[] copyOfValues = values();

	public static EncodingType forName(String name) {
		for (EncodingType value : copyOfValues) {
			if (value.getValue().equals(name)) {
				return value;
			}
		}
		return null;
	}

	@Override
	public String toString() {
		return this.value;
	}
}
